<?php
namespace app\admin\controller;
use think\controller;
use app\admin\model\User as UserModel;

class User extends controller {

    //创建用户数据页面
    public function create() {
        return view("user");
    }

    //新增用户数据
    public function add() {
        $user = new UserModel;
        if($user->allField(true)->save(input('post.'))) {
            return 'user['.$user->clickname.':'.$user->id.']add success';
        }
        else {
            return $user->getError();
        }
    }
}
